Skip to content

Conversation

john-corcoran
Copy link

Hi, I encountered a UnicodeDecodeError when reading some data that was quite badly corrupted. This occurred when iterating through a JSONResultsReader. Error occurred using Python 3.10.5.

Error was:

UnicodeDecodeError: 'utf-8' codec can't decode byte [val] in position [val]: invalid continuation byte

The stacktrace points to json.loads (imported as json_loads) - this pull request catches the exception and re-reads, ignoring the decode error. It may be beneficial to raise a warning to the user, but apologies as I'm not familiar enough with the codebase for that just yet :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant